<%@ page language="java" pageEncoding="UTF-8"%>
<%--
--%>
<%@ include file="/commons/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>CSS美化的漂亮搜索框</title>
		<style type="text/css">
body {
	font: normal 100% 'Arial', 'Helvetica', 'Verdana', sans-serif;
	color: #333;
}

p {
	padding: 12px 0;
	margin: 0;
	font-size: .8em;
	line-height: 1.5;
}

form {
	margin: 0;
}

#search_box {
	width: 201px;
	height: 31px;
	background: url(${ctx}/res/images/search/bg_search_box.gif);
}

#search_box #s {
	float: left;
	padding: 0;
	margin: 6px 0 0 6px;
	border: 0;
	width: 159px;
	background: none;
	font-size: .8em;
}

#search_box #go {
	float: right;
	margin: 3px 4px 0 0;
}
</style>

		<script type="text/javascript">
	function search_onfocus() {
		alert(this.value);
		if(this.value=='请输入关键词'){
			this.value='';
			this.style.color='#000'
		}
	}
	function search_onblur() {
	alert(this.value);
		if(this.value=='') {
			this.value='请输入关键词';
			this.style.color='#7B7C7D'
		} 
	}
</script>
	</head>
	<body>
		<div id="search_box">
			<form id="search_form" method="post" action="#">
				<input type="text" id="s" value="请输入关键词" class="swap_value"  />
				<input type="image" src="${ctx}/res/images/search/btn_search_box.gif"
					width="27" height="24" id="go" alt="Search" title="Search" />
			</form>
		</div>
		<div>搜索框表单为空时不能提交搜索的代码</div>
		<form target="_blank" method="get" action="http://so.0125.com"
			accept-charset="gb2312" onsubmit="document.charset='gb2312';">
			<input type="text" value="请输入关键词"
				onfocus="javascript:if(this.value=='请输入关键词'){this.value='';this.style.color='#000'}"
				onblur="javascript:if
(this.value==''){this.value='请输入关键词';this.style.color='#7B7C7D'}"
				id="kww" name="wd" autocomplete="off" />
			<input type="submit" class="btn" value="搜索"
				onclick="javascript:var input=document.getElementById('kww');if(input.value=='请输入关键词')
{input.value='';input.focus();input.style.color='#000';return false;} return true;" />

		</form>
	</body>
</html>
